<template>
	<view>
		<!-- <u-search placeholder="请输入关键字" v-model="keyword"></u-search> -->
		<u-search
			v-model="keyword"
			:show-action="false"
			@change="getlist"
			placeholder="请输入关键字"
		></u-search>
		<u-list @scrolltolower="scrolltolower">
			<u-list-item v-for="(item, index) in buildlist" :key="index">
				<u-cell :title="(index+1)+'、'+ item.Name" isLink @click="openpage" :name="item.Id" icon="https://cdn.uviewui.com/uview/example/tag.png">

				</u-cell>
			</u-list-item>
		</u-list>
		<u-empty v-if='buildlist.length==0'
		        mode="list"
		        icon="http://cdn.uviewui.com/uview/empty/list.png"
		>
		</u-empty>
	</view>
</template>

<script>
	import {
		getbuildlist
	} from '@/common/api.js'
	export default {
		data() {
			return {
				buildlist: [],
				keyword: ""
			}
		},
		onLoad()
		{
			this.getlist()
		},
		methods: {
			scrolltolower()
			{},
		openpage(e)
		{ 
			uni.$u.route({
				url: "pages/index/buildsafelist?buildid="+e.name
			})
		},
			getlist() {
				// let querytype = this.$route.query.querytype
				let para = {
					Parameters:[],
				}
				if (this.keyword != "") {
					para.Parameters.push({
						FieldName: "Name",
						ConditionalType: "Like",
						FieldValue: this.keyword
					})
				}

				// if (querytype == "日志") {


				// }
				getbuildlist(para).then(res => {
					this.buildlist = res.data
				})
			}
		},
		}
</script>

<style>

</style>
